#include "mainwindow.h"
#include <QtWidgets/QApplication>
#include "QSplashScreen.h"
#include "QString.h"
#include "qdatetime.h"

void delaymsec(int msec);

int main(int argc, char *argv[])
{
	QApplication a(argc, argv);
	a.setWindowIcon(QIcon(":/mainwindow/images/qt_image.png"));
	QSplashScreen *splash = new QSplashScreen( QPixmap(":/mainwindow/images/startimage.jpg"));
	splash->show();
	delaymsec(100);
	mainwindow w;
	Qt::Alignment topRight = Qt::AlignTop|Qt::AlignRight;
	splash->showMessage(QObject::tr("setup main window"),topRight,Qt::white);
	delaymsec(100);

	
	w.show();
	splash->finish(&w);
	delete splash;
	return a.exec();
}

void delaymsec(int msec) {
	QTime n=QTime::currentTime();   
	QTime now;    
	do{      
		now=QTime::currentTime();
	}while (n.msecsTo(now)<=msec);
}
